# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AccessContextManager.V1.Model.AccessSettings do
  @moduledoc """
  Access settings represent the set of conditions that must be met for access to be granted. At least one of the fields must be set.

  ## Attributes

  *   `accessLevels` (*type:* `list(String.t)`, *default:* `nil`) - Optional. Access level that a user must have to be granted access. Only one access level is supported, not multiple. This repeated field must have exactly one element. Example: "accessPolicies/9522/accessLevels/device_trusted"
  *   `sessionSettings` (*type:* `GoogleApi.AccessContextManager.V1.Model.SessionSettings.t`, *default:* `nil`) - Optional. Session settings applied to user access on a given AccessScope.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :accessLevels => list(String.t()) | nil,
          :sessionSettings => GoogleApi.AccessContextManager.V1.Model.SessionSettings.t() | nil
        }

  field(:accessLevels, type: :list)
  field(:sessionSettings, as: GoogleApi.AccessContextManager.V1.Model.SessionSettings)
end

defimpl Poison.Decoder, for: GoogleApi.AccessContextManager.V1.Model.AccessSettings do
  def decode(value, options) do
    GoogleApi.AccessContextManager.V1.Model.AccessSettings.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.AccessContextManager.V1.Model.AccessSettings do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
